local skel = fk.CreateSkill{
  name = "lb__bingyou",
}

Fk:loadTranslationTable{
  ["lb__bingyou"] = "冰佑",
  [":lb__bingyou"] = "出牌阶段，你可以将手牌中一张装备牌置入一名角色的装备区（替换原装备），然后视为对攻击范围内包含其的一名其他角色使用冰【杀】。",

  ["#lb__bingyou_damage"] = "冰佑",
  ["#lb__bingyou_use"] = "冰佑：请视为对攻击范围包含 %dest 的一名其它角色使用冰【杀】",
  ["#lb__bingyou"] = "冰佑：你可以将手牌中一张装备牌置入一名角色的装备区（替换原装备）",
  
  ["$lb__bingyou1"] = "本姑娘出马，怎么可能会输嘛！",
  ["$lb__bingyou2"] = "乖乖站好，这就给你加个祝福！",
}

skel:addEffect("active", {
  prompt = "#lb__bingyou",
  anim_type = "support",
  card_filter = function (self, player, to_select, selected)
    return #selected == 0 and Fk:getCardById(to_select).type == Card.TypeEquip and table.contains(player:getCardIds("h"), to_select)
  end,
  target_filter  = function (self, player, to_select, selected, selected_cards)
    return #selected == 0 and #selected_cards == 1 and to_select:canMoveCardIntoEquip(selected_cards[1])
  end,
  feasible = function (self, player, selected, selected_cards, card)
    return #selected == 1 and #selected_cards == 1
  end,
  on_use = function(self, room, effect)
    local player = effect.from
    local target = effect.tos[1]
    room:moveCardIntoEquip(target, effect.cards, skel.name, true, player)
    local tos = table.filter(room:getOtherPlayers(target), function (to)
      return to:inMyAttackRange(target) and to ~= player
    end)
    if #tos > 0 then
      room:askToUseVirtualCard(player, {
        name = "ice__slash",
        skill_name = skel.name,
        extra_data = {exclusive_targets = table.map(tos, Util.IdMapper)},
        cancelable = false,
        prompt = "#lb__bingyou_use::"..target.id,
      })
    end
  end,
})

return skel